<link href="style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="ORD_TAB/media/js/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $('#tabel').dataTable({
            "sPaginationType": 'full_numbers',
        });
    });
</script>

<p style="color:#222; font-size:12px; font-weight:600; margin:10px;">Você está em: <a href="?pagina=home">Painel Administrativo</a> / Listagem de Cores</p>
<br>
<h3 class="bot_cad"><a href="index.php?pagina=cor-cadastro" alt="" >Novo Cadastro</a></h3>
<?php
include_once('facilitador.php');
conexao();
bloqueia();
$tab = "cor";

$sql = $MQ("SELECT * FROM ".$tab." ORDER BY id ");
if (mysql_affected_rows() == 0) {
    echo '<h4 style="color:#333">Nenhum registro cadastrado ainda </h4>';
} else {
    ?>   
    <table class="tab" id="tabel" border="0" cellspacing="2" cellpadding="0">
        <thead>
            <tr>
                <th width="200" height="30" valign="middle"><strong>Cor:</strong></th>
                <th width="50" align="center" valign="middle"><strong>Editar</strong></th>
                <th width="50" align="center" valign="middle"><strong>Excluir</strong></th>
            </tr>
        </thead>
        <tbody>
            <?php
        }
        while ($linha = $MFA($sql)) {
            $id = $linha['id'];
            $cor = $linha['cor'];
            
            ?>
            <tr>
                <td valign="middle" bgcolor="#B1B1B1"><?php echo stripslashes($cor); ?></td>
                <td width="50" align="center" valign="middle" bgcolor="#B1B1B1"><a href="?pagina=cor-cadastro&id=<?php echo $id; ?>&funcao=Editar" alt="" ><img src="Icones/reload.png" width="20" height="20"/></a></td>
                <td width="50" align="center" valign="middle" bgcolor="#B1B1B1"><a href="?pagina=cor-cadastrar&funcao=Excluir&id=<?php echo $id; ?>" alt="" ><img src="Icones/cancel.png" width="20" height="20"/></a></td>
            </tr>
        <?php } ?>     
    </tbody>
</table>